<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>书籍信息</title>
    <script src="https://cdn.staticfile.org/jquery/3.4.0/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
</head>
<body>
<div>
    <h1>书籍信息</h1>
    <button id="logout">登出</button>
    <table border="1">
        <thead>
        <tr>
            {% for th in thead %}
                <th>{{ th }}</th>
            {% endfor %}
        </tr>
        </thead>
        <tbody>
        {% for row in tbody %}
            <tr>
                {% for td in row %}
                    <td>{{ td }}</td>
                {% endfor %}
            </tr>
        {% endfor %}
        </tbody>
    </table>
</div>
<script>
    $(function () {
        $('#logout').click(function () {
            if ($.cookie('user', '')){
                alert('logout success')
            }else{
                alert('logout failed')
            }
        })
    })
</script>
</body>
</html>